"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/11/13 11:01
"""


class Student2501:
    teacher = 'A'  # 类属性, 所有实例共享,可以作为属性来调用

    def __init__(self, a):  # 初始属性
        self.name = a

    @classmethod
    def get_teacher(cls):  # cls代表当前类类Student2501
        print(cls.teacher)  # 等于Student2501.teacher


Student2501.get_teacher()
stu1 = Student2501('Anna')
stu1.get_teacher()
Student2501.get_teacher()
